﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tzw.Common;

namespace JTG.CheckInMachine
{
    public partial class MsgBox : Form
    {
        private int _timeOut = App.GlobSettings.MsgShowTimes;

        public MsgBox(string msg)
        {
            InitializeComponent();
            Logger.Default.Info(msg);
            if (App.GlobSettings.IsDebugger)
            {
                textBox1.Text = msg;
            }
            else
            {
                textBox1.Text = App.GlobSettings.ShowMsgTxt;
            }
            Show();

            TransparencyKey = Color.FromArgb(7, 35, 72);
            BackColor = Color.FromArgb(7, 35, 72);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            _timeOut--;
            button1.Text = $"确定({_timeOut})";
            if (_timeOut <= 0) Close();
        }

    }
}